package models.cms;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

import models.BeanDtoImpl;
import play.api.templates.Html;

public class PageDto extends BeanDtoImpl implements Serializable {

	private static final long serialVersionUID = 1L;

	public static final String USER = "user";

	public static final String CONTENT = "content";
	
	private Integer id;
	
	private String name;
	
	private String description;
	
	private LayoutDto layout;

	private Map<String,BlockDto> blocks;
	
	private Map<String, Html> renderBlocks;
	
	private Map<String,String[]> params = new HashMap<String,String[]>();
	
	private Map<String, Object> data = new HashMap<String,Object>();
	

	public Integer getId() {
		return id;
	}
	
	public void addRenderBlocks(String zone, Html content){
		if(renderBlocks == null){
			renderBlocks = new HashMap<String,Html>();
		}
		renderBlocks.put(zone,content);
	}
	
	public void addData(String key, Object value){
		if(data == null){
			data = new HashMap<String,Object>();
		}
		data.put(key,value);
	}
	
	public void addParams(String key, String value){
		if(params == null){
			params = new HashMap<String,String[]>();
		}
		params.put(key,new String[]{value});
	}
	
	public void addParams(Map<String, String[]> queryString) {
		if(params == null){
			params = new HashMap<String,String[]>();
		}
		params.putAll(queryString);
	}
	
	public void addParams(String key, String[] values){
		if(params == null){
			params = new HashMap<String,String[]>();
		}
		params.put(key,values);
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public LayoutDto getLayout() {
		return layout;
	}

	public void setLayout(LayoutDto layout) {
		this.layout = layout;
	}

	public Map<String, BlockDto> getBlocks() {
		return blocks;
	}

	public void setBlocks(Map<String, BlockDto> blocks) {
		this.blocks = blocks;
	}

	public Map<String, Html> getRenderBlocks() {
		return renderBlocks;
	}

	public void setRenderBlocks(Map<String, Html> renderBlocks) {
		this.renderBlocks = renderBlocks;
	}

	public Map<String, String[]> getParams() {
		return params;
	}

	public void setParams(Map<String, String[]> params) {
		this.params = params;
	}

	public Map<String, Object> getData() {
		return data;
	}

	public void setData(Map<String, Object> data) {
		this.data = data;
	}

	

}
